package com.ourteam.product.model.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Tue Nov 07 10:29:34 IRKT 2017
 * Auto Generate Date : 2017-11-15 14:53:32
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class ProductModelCodeTemplateBean implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("id",
            com.ourteam.product.model.dao.IProductModelCodeTemplateDAO.Id);

        mappedDaoFields.put("generateCodeType",
            com.ourteam.product.model.dao.IProductModelCodeTemplateDAO.GenerateCodeType);

        mappedDaoFields.put("targetType",
            com.ourteam.product.model.dao.IProductModelCodeTemplateDAO.TargetType);

        mappedDaoFields.put("templateName",
            com.ourteam.product.model.dao.IProductModelCodeTemplateDAO.TemplateName);

        mappedDaoFields.put("fileNameTemplate",
            com.ourteam.product.model.dao.IProductModelCodeTemplateDAO.FileNameTemplate);

        mappedDaoFields.put("fileType",
            com.ourteam.product.model.dao.IProductModelCodeTemplateDAO.FileType);

        mappedDaoFields.put("fileContentTemplate",
            com.ourteam.product.model.dao.IProductModelCodeTemplateDAO.FileContentTemplate);

        mappedDaoFields.put("canOverWrite",
            com.ourteam.product.model.dao.IProductModelCodeTemplateDAO.CanOverWrite);

        mappedDaoFields.put("status",
            com.ourteam.product.model.dao.IProductModelCodeTemplateDAO.Status);

        mappedDaoFields.put("remarks",
            com.ourteam.product.model.dao.IProductModelCodeTemplateDAO.Remarks);

        mappedDaoFields.put("inputObjectType",
            com.ourteam.product.model.dao.IProductModelCodeTemplateDAO.InputObjectType);

        mappedDaoFields.put("fileOutputPath",
            com.ourteam.product.model.dao.IProductModelCodeTemplateDAO.FileOutputPath);

        mappedDaoFields.put("templateVersion",
            com.ourteam.product.model.dao.IProductModelCodeTemplateDAO.TemplateVersion);

        mappedDaoFields.put("lastModifyTime",
            com.ourteam.product.model.dao.IProductModelCodeTemplateDAO.LastModifyTime);

        mappedDaoFields.put("lastModifyUser",
            com.ourteam.product.model.dao.IProductModelCodeTemplateDAO.LastMofiyUser);

        mappedDaoFields.put("templateCode",
            com.ourteam.product.model.dao.IProductModelCodeTemplateDAO.TemplateCode);
    }

    private com.ourteam.product.model.dao.ProductModelCodeTemplate productModelCodeTemplate;

    public ProductModelCodeTemplateBean() {
        super();

        this.productModelCodeTemplate = new com.ourteam.product.model.dao.ProductModelCodeTemplate();
    }

    public ProductModelCodeTemplateBean(
        com.ourteam.product.model.dao.ProductModelCodeTemplate productModelCodeTemplate) {
        super();

        this.productModelCodeTemplate = productModelCodeTemplate;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(productModelCodeTemplate);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.product.model.dao.ProductModelCodeTemplate convertToProductModelCodeTemplate() {
        return this.productModelCodeTemplate;
    }

    public com.ourteam.product.model.dao.ProductModelCodeTemplate convertTo() {
        return this.productModelCodeTemplate;
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.productModelCodeTemplate.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.productModelCodeTemplate.setId(id);
    }

    /**
     * Get generateCodeType
     *
     * @return String
     */
    public String getGenerateCodeType() {
        return (String) this.productModelCodeTemplate.getGenerateCodeType();
    }

    /**
     * Set generateCodeType
     *
     * @parameter String
     */
    public void setGenerateCodeType(String generateCodeType) {
        this.productModelCodeTemplate.setGenerateCodeType(generateCodeType);
    }

    /**
     * Get targetType
     *
     * @return String
     */
    public String getTargetType() {
        return (String) this.productModelCodeTemplate.getTargetType();
    }

    /**
     * Set targetType
     *
     * @parameter String
     */
    public void setTargetType(String targetType) {
        this.productModelCodeTemplate.setTargetType(targetType);
    }

    /**
     * Get templateName
     *
     * @return String
     */
    public String getTemplateName() {
        return (String) this.productModelCodeTemplate.getTemplateName();
    }

    /**
     * Set templateName
     *
     * @parameter String
     */
    public void setTemplateName(String templateName) {
        this.productModelCodeTemplate.setTemplateName(templateName);
    }

    /**
     * Get fileNameTemplate
     *
     * @return String
     */
    public String getFileNameTemplate() {
        return (String) this.productModelCodeTemplate.getFileNameTemplate();
    }

    /**
     * Set fileNameTemplate
     *
     * @parameter String
     */
    public void setFileNameTemplate(String fileNameTemplate) {
        this.productModelCodeTemplate.setFileNameTemplate(fileNameTemplate);
    }

    /**
     * Get fileType
     *
     * @return String
     */
    public String getFileType() {
        return (String) this.productModelCodeTemplate.getFileType();
    }

    /**
     * Set fileType
     *
     * @parameter String
     */
    public void setFileType(String fileType) {
        this.productModelCodeTemplate.setFileType(fileType);
    }

    /**
     * Get fileContentTemplate
     *
     * @return String
     */
    public String getFileContentTemplate() {
        return (String) this.productModelCodeTemplate.getFileContentTemplate();
    }

    /**
     * Set fileContentTemplate
     *
     * @parameter String
     */
    public void setFileContentTemplate(String fileContentTemplate) {
        this.productModelCodeTemplate.setFileContentTemplate(fileContentTemplate);
    }

    /**
     * Get canOverWrite
     *
     * @return String
     */
    public String getCanOverWrite() {
        return (String) this.productModelCodeTemplate.getCanOverWrite();
    }

    /**
     * Set canOverWrite
     *
     * @parameter String
     */
    public void setCanOverWrite(String canOverWrite) {
        this.productModelCodeTemplate.setCanOverWrite(canOverWrite);
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.productModelCodeTemplate.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.productModelCodeTemplate.setStatus(status);
    }

    /**
     * Get remarks
     *
     * @return String
     */
    public String getRemarks() {
        return (String) this.productModelCodeTemplate.getRemarks();
    }

    /**
     * Set remarks
     *
     * @parameter String
     */
    public void setRemarks(String remarks) {
        this.productModelCodeTemplate.setRemarks(remarks);
    }

    /**
     * Get inputObjectType
     *
     * @return String
     */
    public String getInputObjectType() {
        return (String) this.productModelCodeTemplate.getInputObjectType();
    }

    /**
     * Set inputObjectType
     *
     * @parameter String
     */
    public void setInputObjectType(String inputObjectType) {
        this.productModelCodeTemplate.setInputObjectType(inputObjectType);
    }

    /**
     * Get fileOutputPath
     *
     * @return String
     */
    public String getFileOutputPath() {
        return (String) this.productModelCodeTemplate.getFileOutputPath();
    }

    /**
     * Set fileOutputPath
     *
     * @parameter String
     */
    public void setFileOutputPath(String fileOutputPath) {
        this.productModelCodeTemplate.setFileOutputPath(fileOutputPath);
    }

    /**
     * Get templateVersion
     *
     * @return int
     */
    public int getTemplateVersion() {
        return (int) this.productModelCodeTemplate.getTemplateVersion();
    }

    /**
     * Set templateVersion
     *
     * @parameter int
     */
    public void setTemplateVersion(int templateVersion) {
        this.productModelCodeTemplate.setTemplateVersion(templateVersion);
    }

    /**
     * Get lastModifyTime
     *
     * @return java.util.Date
     */
    public java.util.Date getLastModifyTime() {
        return (java.util.Date) this.productModelCodeTemplate.getLastModifyTime();
    }

    /**
     * Set lastModifyTime
     *
     * @parameter java.util.Date
     */
    public void setLastModifyTime(java.util.Date lastModifyTime) {
        this.productModelCodeTemplate.setLastModifyTime(lastModifyTime);
    }

    /**
     * Get lastModifyUser
     *
     * @return String
     */
    public String getLastModifyUser() {
        return (String) this.productModelCodeTemplate.getLastMofiyUser();
    }

    /**
     * Set lastModifyUser
     *
     * @parameter String
     */
    public void setLastModifyUser(String lastModifyUser) {
        this.productModelCodeTemplate.setLastMofiyUser(lastModifyUser);
    }

    /**
     * Get templateCode
     *
     * @return String
     */
    public String getTemplateCode() {
        return (String) this.productModelCodeTemplate.getTemplateCode();
    }

    /**
     * Set templateCode
     *
     * @parameter String
     */
    public void setTemplateCode(String templateCode) {
        this.productModelCodeTemplate.setTemplateCode(templateCode);
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof ProductModelCodeTemplateBean) == false) {
            return false;
        } // end if

        ProductModelCodeTemplateBean other = (ProductModelCodeTemplateBean) obj;

        boolean isEqual = false;

        com.ourteam.product.model.dao.ProductModelCodeTemplate tempProductModelCodeTemplate =
            other.convertToProductModelCodeTemplate();

        if ((tempProductModelCodeTemplate == null) ||
                (this.productModelCodeTemplate == null)) {
            isEqual = false;
        } else if ((tempProductModelCodeTemplate == this.productModelCodeTemplate) ||
                tempProductModelCodeTemplate.equals(
                    this.productModelCodeTemplate)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static ProductModelCodeTemplateBean[] toArray(
        com.ourteam.product.model.dao.ProductModelCodeTemplate[] aProductModelCodeTemplates) {
        return toArray(aProductModelCodeTemplates, null);
    }

    public static ProductModelCodeTemplateBean[] toArray(
        com.ourteam.product.model.dao.ProductModelCodeTemplate[] aProductModelCodeTemplates,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aProductModelCodeTemplates)) {
            return new ProductModelCodeTemplateBean[0];
        }

        int length = aProductModelCodeTemplates.length;

        ProductModelCodeTemplateBean[] beans = new ProductModelCodeTemplateBean[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new ProductModelCodeTemplateBean(aProductModelCodeTemplates[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i],
                    new Object[] { aProductModelCodeTemplates[i] });
            }
        }

        return beans;
    }
}
